TDD 주기의 보폭

How large or small should a single TDD cycle be?

How large should your steps be?

There are really two questions lurking here:

  • How much ground should each test cover?
  • How many intermediate stages should you go through as you refactor?

… Part of the answer is that you should be able to do either. The tendency of Test-Driven Developers over time is clear, though—smaller steps. However, folks are experimenting with driving development from application-level tests, either alone or in conjunction with the programmer-level tests we’ve been writing.

At first when you refactor, you should be prepared to take lots of little tiny steps. … Once you’ve done a refactoring 20 times by hand in little tiny steps, experiment with leaving out some of the steps.

—Chapter 32, Test-driven development: by example

Awareness and control

Being able to take small steps:

I’m feeling defensive again about taking such teeny-tiny steps. Am I recommending that you actually work this way? No. I’m recommending that you be able to work this way. … This is the kind of tuning you will be doing constantly with TDD. Are the teeny-tiny steps feeling restrictive? Take bigger steps. Are you feeling a little unsure? Take smaller steps. TDD is a steering process—a little this way, a little that way. There is no right step size, now and forever. —Chapter 9, Test-driven development: by example

TDD is an awareness of the gap between decision and feedback during programming, and techniques to control that gap. —Preface, Test-driven development: by example

Small steps as a way of practice

It is not necessary to work in such tiny steps as these. Once you’ve mastered TDD, you will be able to work in much bigger leaps of functionality between test cases. However, to master TDD you need to be able to work in such tiny steps when they are called for. —Chapter 18, Test-driven development: by example

Time interval between test runs

A histogram of the time interval between test runs. The large number of long intervals is most likely because of the time I spent writing:

Histogram of the time interval between test runs.png

—Chapter 17, Test-driven development: by example

2024 © ak